<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户管理</title>
<s:include value="/app_common/common.jsp"></s:include>
<!-- 日期选择框start -->
<script type="text/javascript" src="<s:property value='webctx'/>/libs/js/form/datePicker/WdatePicker.js"></script>
<!-- 日期选择框end -->
<!--数字分页start-->
<script type="text/javascript" src="<s:property value='webctx'/>/libs/js/nav/pageNumber.js"></script>
<!--数字分页end-->
</head>
<body>
<form name="form1" id="form1" action="<s:property value='webctx'/>/user/user_queryPopupUser.action" method="post">

<div class="padding5">
		<table class="noclass" style="width: 100%" >
			<tr>
				<td>用户编码：</td>
				<td><input type="text" name="user.u_code" value="<s:property value='user.u_code'/>"/></td>
				<td>姓名：</td>
				<td><input type="text" name="user.u_name" value="<s:property value='user.u_name'/>"/></td>
				<s:if test="json_val!=null&&json_val!=''">
					<td>所属部门:</td>
					<td>
						<select name="user.u_ltd" selectedValue="<s:property value='user.u_ltd'/>" prompt="请选择" data='<s:property value="json_val"/>'></select>
						<s:hidden name="user.u_ltd_code"></s:hidden>
						<s:hidden name="result" value="ab"></s:hidden>
					</td>
				</s:if>
				<s:else>
					<s:hidden name="user.u_ltd"></s:hidden>
					<s:hidden name="user.u_ltd_code"></s:hidden>
				</s:else>
			</tr>
			<tr>
				<td colspan="6" align="center" >
					<button type="button" onclick="resets()"><span class="icon_reload">重置</span></button>&nbsp;
					<button type="button" onclick="search()"><span class="icon_find">查询</span></button>
				</td>
			</tr>
		</table>
</div>
<div>
	<table class="tableStyle" sortMode="true" headFixMode="true" useMultColor="true">
		<tr>
			<th width="80">用户编码</th>
			<th width="80">姓名</th>
			<th width="80">性别</th>
			<th width="80">所属部门</th>
			<th width="80">操作</th>
		</tr>
	</table>
</div>
<div id="winScrollContent">
	<table class="tableStyle" headFixMode="true">

		<s:iterator value="page.result" status="stat">
		<tr ondblclick="onCheck('<s:property value="u_code"/>','<s:property value="u_name"/>')">
			<td width="80"><s:property value="u_code"/></td>
			<td width="80"><s:property value="u_name"/></td>
			<td width="80"><s:property value="u_sex==0?'男':'女'"/></td>
			<td width="80"><s:property value="u_ltd_name"/></td>
			<td width="80" align="center">
				<a href="#" onclick="onCheck('<s:property value="u_code"/>','<s:property value="u_name"/>')">选择</a>
			</td>
		</tr>
		</s:iterator>
	</table>
</div>
<!-- 分页 -->
<div style="height:35px;">
	<div class="float_left padding5">共查询<s:property value='total'/>条数据</div>
	<div class="float_right padding5">
		<div class="pageNumber" total="<s:property value='total'/>" page="<s:property value='currentPage-1'/>" pageSize="<s:property value='size'/>" showSelect="true" showInput="true" id="page"></div>
	</div>
	<div class="clear"></div>
</div>
<s:hidden name="currentPage"/>
<s:hidden name="size"/>
</form>
</body>
<script type="text/javascript">
var frameObj = "<s:property value='#parameters.obj'/>";
//分页事件
$("#page").bind("pageChange",function(e,index){
	$('#currentPage').val(index+1);
	document.form1.submit();
}).bind("sizeChange",function(e,num){
	$('#size').val(num);
	document.form1.submit();
});
//搜索
function search(){
	document.form1.submit();
}
//重置
function resets(){
	$('.noclass input').val('');
	var opt = $('#u_sex option:eq(0)');
	opt.attr('selected',true);
	$('.noclass .selectbox').val(opt.text());
}
function onCheck(obj,obj1){
	if(frameObj!=null&&frameObj=="1"){
		top.frmright.frmrightChild.document.getElementById("user_code").value=obj;
		top.frmright.frmrightChild.document.getElementById("user_name").value=obj1;
	}else{
		top.frmright.document.getElementById("user_code").value=obj;
		top.frmright.document.getElementById("user_name").value=obj1;
		$(top.frmright.document.getElementById("cn")).text(obj1+"  重新选择");
	}
	alert('选择用户,'+obj1+'成功!');
	
	top.Dialog.close();
}

</script>
</html>